package com.yykj.common.util;

import java.util.Random;

/**
 * @author chenl
 * @version 1.0
 * @date 2021/10/24 22:50
 */
public class RandomUtil {

    private static final Random RANDOM = new Random();

    /**
     * 生成指定位数的随机数字字符串
     *
     * @param length 字符串长度
     * @return 随机数字字符串
     */
    public static String randomNumbers(int length) {
        StringBuilder randomNumbers = new StringBuilder();
        for (int i = 0; i < length; i++) {
            randomNumbers.append(RANDOM.nextInt(10));
        }
        return randomNumbers.toString();
    }
}
